# Custom Types

## <Type>context</Type>

A {{dictionary}} that holds the internal state of the canvas such as the element dictionary, the current transformation matrix, group and canvas unit length.
The following fields are considered stable:
- length (length): Length of one canvas unit as typst length
- transform (matrix): Current 4x4 transformation matrix
- background (none,color,gradient,tiling): The canvas' background
- debug (bool): True if the canvas' debug flag is set
- shared-state (dictionary): State that is not scoped by `group` or `scope` elements and can be used to share canvas-global state

## <Type>element</Type>

A function that, when called with a <Type>context</Type>, returns some data that effects the canvas. Can also be an <Type>array</Type> of this type.
